Introduction to Tornado by Michael Dory
Author:Michael Dory
Language: eng
Format: epub, pdf
Publisher: O'Reilly Media
Published: 2012-03-21T00:00:00+00:00
def get(self, isbn=None): book = dict() if isbn: coll = self.application.db.books book = coll.find_one({"isbn": isbn}) self.render("book_edit.html", page_title="Burt's Books", header_text="Edit book", book=book)
If the method is invoked as a result of a request to /add, Tornado will call the get method without a second argument (as there’s no corresponding group in the regular expression for the path). In this case, the default, an empty book dictionary is passed to the book_edit.html template.
If the method was called as a result of a request to, for example, /edit/0-123-456, the isbn parameter is set to the value 0-123-456. In this case, we get the books collection from our Application instance and use it to look up the book with the corresponding ISBN. Then we pass the resulting book dictionary into the template.
Here’s the template (book_edit.html):
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Man-made Catastrophes and Risk Information Concealment by Dmitry Chernov & Didier Sornette(5958)
The Revenge of Geography: What the Map Tells Us About Coming Conflicts and the Battle Against Fate by Kaplan Robert D(4053)
Zero Waste Home by Bea Johnson(3809)
COSMOS by Carl Sagan(3593)
Good by S. Walden(3523)
In a Sunburned Country by Bill Bryson(3509)
The Fate of Rome: Climate, Disease, and the End of an Empire (The Princeton History of the Ancient World) by Kyle Harper(3035)
A Wilder Time by William E. Glassley(2838)
Camino Island by John Grisham(2781)
Organic Mushroom Farming and Mycoremediation by Tradd Cotter(2664)
The Ogre by Doug Scott(2659)
Human Dynamics Research in Smart and Connected Communities by Shih-Lung Shaw & Daniel Sui(2479)
Energy Myths and Realities by Vaclav Smil(2464)
The Traveler's Gift by Andy Andrews(2438)
9781803241661-PYTHON FOR ARCGIS PRO by Unknown(2345)
Inside the Middle East by Avi Melamed(2332)
Birds of New Guinea by Pratt Thane K.; Beehler Bruce M.; Anderton John C(2239)
A History of Warfare by John Keegan(2216)
And the Band Played On by Randy Shilts(2170)